<?php 
	session_start();
	$exceptions = array("login", "register");
	if((!isset($_SESSION['username'])) && (!in_array($_GET['page'], $exceptions))){
		header("Location: /ez-todo/?page=login");
	}
	if(!isset($_GET['page'])){
		header("Location: /ez-todo/?page=taskList");
	}
?>
<html>
	<head>
		<title>EZ-TODO</title>
		<script src="./js/jquery-1.11.1.min.js"></script>
		<script src="./ckeditor/ckeditor.js"></script>
		<script src="./js/todo.js"></script>
		<link rel="stylesheet" type="text/css" href="./css/todo.css">
	</head>
	<body>
		<meta name="description" content="Easy todo list appication" />
		<meta name="author" content="Joseph Fehrman" />
		<div id="header">
			<h1 id="title">EZ-TODO</h1>
			<ul id="menu">
				<li><a href="./index.php">Home</a></li>
				<li><a href="./?page=taskList">Task List</a></li>
				<li><a href="./?page=taskList&finish=1">Completed Task</a></li>
				<li><a href="./?page=newTask">Create New Task</a></li>
			</ul>
<?php if(isset($_SESSION['username'])){ ?>
			<ul id="account_options">
				<li><a href="./process/processLogOut.php">Log Out</a></li>
				<li><a href="./?page=manageAccount">My Profile</a></li>
			</ul>
<?php } ?>
		</div>
		<br/>